Add assembly status busy/terminal helpers#280
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c55bcc6769
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| export function isAssemblyTerminalError(assembly: AssemblyStatus | undefined | null): boolean { | ||
| return isAssemblyErrorStatus(getError(assembly)) |
There was a problem hiding this comment.
Treat sys-error assemblies as terminal in helpers
isAssemblyTerminalError only checks getError(assembly), so assemblies that match assemblyStatusSysErrSchema (the schema explicitly documents system errors without ok/error) will return false here and therefore isAssemblyTerminal will also be false. This means callers relying on these helpers will treat low-level system failures as non-terminal and may wait indefinitely for completion. Consider treating the sys-error shape (e.g., presence of errno/code/syscall) as a terminal error in these helpers.
Useful? React with 👍 / 👎.
Summary
ASSEMBLY_UPLOADING,ASSEMBLY_EXECUTING, andASSEMBLY_REPLAYING.isAssemblyBusyStatus,isAssemblyOkStatus,isAssemblyErrorStatus,isAssemblyTerminalOkStatus) plus assembly-level helpers (isAssemblyBusy,isAssemblyTerminalOk,isAssemblyTerminalError,isAssemblyTerminal).hasOk/hasErrorsemantics.Why
ASSEMBLY_EXECUTINGandASSEMBLY_UPLOADINGas in-flight states, andASSEMBLY_REPLAYINGis returned immediately after a replay is triggered.Notes
ASSEMBLY_FAILED/ASSEMBLY_ABORTEDare not present in api2 or alphalib today, so they are intentionally omitted.